import { FixedSizeSprite } from "../common/display/FixedSizeSprite";
import { ColorConfig } from "../../resource/ColorConfig";
import { SPublicNotice } from "../../../../Message/Public/SPublicNotice";
import { ChatMessageWorking } from "../chat/chatViewData/ChatMessageWorking";
import { ChatItemData } from "../chat/chatViewData/ChatItemData";
import { ChatType } from "../chat/chatViewData/ChatType";
import { ChatCellData } from "../chat/chatViewData/ChatCellData";
import { ObjectPool } from "../../../../com/gengine/utils/pools/ObjectPool";
import { ChatNotes } from "../chat/chatPanel/ChatNotes";
type int = number;
//class TreasureOverViewNewRender
    
    export  class TreasureOverViewNewRender extends FixedSizeSprite
    {
        constructor()
        {
            super();
            return;
        }

        public setData(arg1: Object, arg2: int=180, arg3: int=50): void
        {
            var loc4=null;
            var loc5=null;
            var loc1=16777215;
            var loc2;
            if (loc2 = ColorConfig.instance.getChatColor("Rumor")) 
            {
                loc1 = loc2.intColor;
            }
            this.dispose();
            var loc3;
            (loc3 = arg1 as SPublicNotice).content = ChatMessageWorking.getNoticeContent(loc3);
            if (this._chatItemData == null) 
            {
                this._chatItemData = new ChatItemData();
            }
            this._chatItemData.type = ChatType.Legent;
            loc5 = (loc5 = new Vector.<ChatCellData>()).concat(ChatMessageWorking.getCellDatasByAnalyzeRumor(loc3.content, loc3.publicMiniplayers, loc1));
            this._chatItemData.cellVector = loc5;
            this._chatNotes = ObjectPool.getObject(ChatNotes);
            this._chatNotes.init(this._chatItemData, arg2, arg3);
            this.addChild(this._chatNotes);
            return;
        }

        public dispose(): void
        {
            if (this._chatNotes && this.contains(this._chatNotes)) 
            {
                this._chatNotes.dispose();
                this.removeChild(this._chatNotes);
            }
            return;
        }

        public /* override */ get height(): number
        {
            return this._chatNotes.height;
        }

        protected /* var */_chatNotes: ChatNotes;

        protected /* var */_chatItemData: ChatItemData;
    }
